<?php


namespace app\api\controller\mall;


use app\api\controller\ApiBase;
use app\common\business\Goods;
use app\common\lib\Show;

//商品详情页
class Detail extends ApiBase
{
    public function index()
    {

        //获取sku id
        $id = input("param.id", 0, "intval");
        if (!$id) {
            return Show::error();
        }

        $result = (new Goods())->getGoodsDetailBySkuId($id);
        if (!$result) {
            return Show::error();
        }

        return Show::success($result);
    }
}